<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>FalconKMS Installer Step 2</title>

<style>
p {
	font-family:Verdana, Arial, Helvetica, sans-serif;
	font-size:14px;
}
</style>
</head>

<?php 

include_once "../config.php";

$sql ="CREATE TABLE `kb_alliance` (
  `allianceID` int(11) NOT NULL auto_increment,
  `allianceName` varchar(99) NOT NULL default '',
  `filter` int(1) NOT NULL,
  PRIMARY KEY  (`allianceID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;";

$queryResult = mysql_query($sql);

$sql = "CREATE TABLE `kb_corp` (
  `corpID` int(11) NOT NULL auto_increment,
  `corpName` varchar(99) NOT NULL default '',
  `allianceID` int(11) NOT NULL default '0',
  `killPoints` int(11) NOT NULL default '0',
  `lossPoints` int(11) NOT NULL default '0',
  `netPoints` int(11) NOT NULL default '0',
  `npcCorp` int(11) NOT NULL default '0',
  `filter` int(1) NOT NULL,
  PRIMARY KEY  (`corpID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;";

$queryResult = mysql_query($sql);

$sql = "CREATE TABLE `kb_destroyed` (
  `destroyedID` int(11) NOT NULL auto_increment,
  `killID` int(11) NOT NULL default '0',
  `itemID` int(11) NOT NULL default '0',
  `location` int(11) NOT NULL default '0',
  `quantity` bigint(20) NOT NULL default '0',
  PRIMARY KEY  (`destroyedID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;";

$queryResult = mysql_query($sql);

$sql = "CREATE TABLE `kb_errors` (
  `errorID` int(11) NOT NULL auto_increment,
  `module` text NOT NULL,
  `description` text NOT NULL,
  `date` text NOT NULL,
  PRIMARY KEY  (`errorID`)
) ENGINE=MyISAM  AUTO_INCREMENT=1 ;";

$queryResult = mysql_query($sql);

$sql = "CREATE TABLE `kb_evegraphics` (
  `graphicID` int(11) NOT NULL default '0',
  `icon` char(100) default NULL,
  PRIMARY KEY  (`graphicID`)
) ENGINE=MyISAM ;";

$queryResult = mysql_query($sql);

$sql = "CREATE TABLE `kb_involved` (
  `involvedID` int(11) NOT NULL auto_increment,
  `killID` int(11) NOT NULL default '0',
  `playerID` int(11) NOT NULL default '0',
  `corpID` int(11) NOT NULL default '0',
  `allianceID` int(11) NOT NULL,
  `shipID` int(11) NOT NULL default '0',
  `weaponID` int(11) NOT NULL default '0',
  `finalBlow` int(11) NOT NULL default '0',
  `involvedTime` double NOT NULL default '0',
  PRIMARY KEY  (`involvedID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;";

$queryResult = mysql_query($sql);

$sql = "CREATE TABLE `kb_kill` (
  `killID` int(11) NOT NULL auto_increment,
  `playerID` int(11) NOT NULL default '0',
  `corpID` int(11) NOT NULL default '0',
  `allianceID` int(11) NOT NULL,
  `shipID` int(11) NOT NULL default '0',
  `systemID` int(11) NOT NULL default '0',
  `killTime` double NOT NULL default '0',
  `parsedMail` text NOT NULL,
  PRIMARY KEY  (`killID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;";

$queryResult = mysql_query($sql);

$sql = "CREATE TABLE `kb_player` (
  `playerID` int(11) NOT NULL auto_increment,
  `playerName` varchar(99) NOT NULL default '',
  `killPoints` int(11) NOT NULL default '0',
  `lossPoints` int(11) NOT NULL default '0',
  `netPoints` int(11) NOT NULL default '0',
  `corpID` int(11) NOT NULL default '0',
  `password` varchar(99) default NULL,
  `canPost` tinyint(1) NOT NULL,
  `canAdmin` tinyint(1) NOT NULL,
  `filter` int(1) NOT NULL,
  PRIMARY KEY  (`playerID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;";

$queryResult = mysql_query($sql);

$sql = "CREATE TABLE `kb_settings` (
  `enableKillboard` int(1) NOT NULL default '1',
  `allowLogins` int(1) NOT NULL default '1',
  `submitLevel` int(1) NOT NULL default '0',
  `submitPassword` varchar(99) NOT NULL COMMENT 'For Shared Password mode only'
) ENGINE=MyISAM ;";

$queryResult = mysql_query($sql);

$sql = "CREATE TABLE `kb_ship` (
  `shipID` int(11) NOT NULL auto_increment,
  `shipName` varchar(99) NOT NULL,
  `classID` int(11) NOT NULL default '0',
  `points` int(11) NOT NULL default '0',
  `description` longtext NOT NULL,
  `high` int(1) NOT NULL default '0',
  `mid` int(1) NOT NULL default '0',
  `low` int(1) NOT NULL default '0',
  `cpu` int(11) NOT NULL default '0',
  `grid` int(11) NOT NULL default '0',
  PRIMARY KEY  (`shipID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;";

$queryResult = mysql_query($sql);

$sql = "CREATE TABLE `kb_shipclass` (
  `classID` int(11) NOT NULL auto_increment,
  `className` varchar(99) NOT NULL default '',
  PRIMARY KEY  (`classID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 ;";

$queryResult = mysql_query($sql);

$sql = "CREATE TABLE `kb_system` (
  `regionID` int(11) NOT NULL default '0',
  `constellationID` int(11) NOT NULL default '0',
  `solarSystemID` int(11) NOT NULL default '0',
  `solarSystemName` varchar(100) NOT NULL default '',
  `security` float NOT NULL default '0',
  `securityClass` char(2) default NULL
) TYPE=MyISAM;";

$queryResult = mysql_query($sql);

$sql = "CREATE TABLE `kb_type` (
  `typeID` smallint(6) NOT NULL default '0',
  `groupID` smallint(6) NOT NULL default '0',
  `typeName` varchar(100) NOT NULL default '',
  `graphicID` smallint(6) default NULL,
  `volume` float NOT NULL default '0',
  `capacity` float NOT NULL default '0',
  `portionSize` int(11) NOT NULL default '1',
  `raceID` tinyint(4) default NULL,
  `basePrice` float NOT NULL default '0'
) TYPE=MyISAM;";

$queryResult = mysql_query($sql);

$sql = "CREATE TABLE `kb_contracts` (
  `contractID` int(11) NOT NULL auto_increment,
  `dateStarted` timestamp NOT NULL,
  `finished` tinyint(1) NOT NULL default '0',
  `comments` text NOT NULL,
  `public` int(11) NOT NULL default '1',
  PRIMARY KEY (`contractID`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;";

$queryResult = mysql_query($sql);

?>

<body>
<p><b>FalconKMS Installer Step 2</b></p>
<p>The tables for your killboard have been created, you can now proceede to <a href="newinstall3.php">step 3</a></p>
<p><b>PLEASE NOTE:</b> This step may take some time as it is importing eve data.</p>

</body>
</html>